package test.redis;

import redis.clients.jedis.JedisPoolConfig;

/**
 * @Author: sunshuo
 * @Date: 2019/8/8/008 18:53
 * @Version: 1.0
 */
public class RedisConfig {

    public static JedisPoolConfig poolConfig;

    public static String password;

    public static int timeout;

    static {
        poolConfig = new JedisPoolConfig();
        poolConfig.setMaxIdle(RedisProperties.getInteger("redis.maxIdle", 500));
        poolConfig.setMaxTotal(RedisProperties.getInteger("redis.maxTotal", 5000));
        poolConfig.setMaxWaitMillis(RedisProperties.getInteger("redis.maxWaitTime", 1000));
        poolConfig.setTestOnBorrow(RedisProperties.getBoolean("redis.testOnBorrow", true));
        poolConfig.setMinIdle(RedisProperties.getInteger("redis.minIdle", 300));

        password = RedisProperties.getString("redis.password", "fengzi21");
        timeout = RedisProperties.getInteger("redis.timeout", 3000);
    }
}
